xsplice/xen_replace_world: Test-case for XSPLICE_ACTION_REPLACE
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 28 Apr 2016 14:11:46 +0000 (10:11 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 29 Apr 2016 07:59:29 +0000 (03:59 -0400)
commit48a312d1ade7f7df0ee10ae192cb7a09247c14bc
tree413fc079dcd2d4cab6cb3ea7965f3aaa7c82c419
parent895111a94f0168699d5154c7a25bd33865559e2c
xsplice/xen_replace_world: Test-case for XSPLICE_ACTION_REPLACE

With this third payload one can do:

-bash-4.1# xen-xsplice load xen_hello_world.xsplice
Uploading xen_hello_world.xsplice (10148 bytes)
Performing check: completed
Performing apply:. completed

[xen_hello_world depends on hypervisor build-id]
-bash-4.1# xen-xsplice load xen_bye_world.xsplice
Uploading xen_bye_world.xsplice (7076 bytes)
Performing check: completed
Performing apply:. completed
[xen_bye_world depends on xen_hello_world build-id]
-bash-4.1# xen-xsplice upload xen_replace_world xen_replace_world.xsplice
Uploading xen_replace_world.xsplice (7148 bytes)
-bash-4.1# xen-xsplice list
 ID                                     | status
----------------------------------------+------------
xen_hello_world                         | APPLIED
xen_bye_world                           | APPLIED
xen_replace_world                       | CHECKED
-bash-4.1# xen-xsplice replace xen_replace_world
Performing replace:. completed
-bash-4.1# xl info | grep extra
xen_extra              : Hello Again World!
-bash-4.1# xen-xsplice list
 ID                                     | status
----------------------------------------+------------
xen_hello_world                         | CHECKED
xen_bye_world                           | CHECKED
xen_replace_world                       | APPLIED

and revert both of the previous payloads and apply
the xen_replace_world.

All the magic of this is in the Makefile - we extract
the build-id from the hypervisor (xen-syms) and jam it
in the xen_replace_world as .xsplice.depends.

We also make .old_addr be zero, forcing the hypervisor
to lookup the xen_extra_version.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
.gitignore
xen/arch/x86/test/Makefile
xen/arch/x86/test/xen_replace_world.c [new file with mode: 0644]
xen/arch/x86/test/xen_replace_world_func.c [new file with mode: 0644]